<?php
/**
 * 网站地图生成插件
 *
 * 可单独 生成移动端或者电脑端网站地图
 *
 * author：sitemapv2@163.com
 *
 * time:2020-11-23
 */

namespace plugins\sitemapv2;

use cmf\lib\Plugin;

class Sitemapv2Plugin extends Plugin
{

    public $info = [
        'name' => 'Sitemapv2',
        'title' => '生成电脑端和移动端XML地图',
        'description' => '生成电脑端和移动端XML地图',
        'status' => 1,
        'author' => '氵猿木木灬',
        'version' => '1.2',
        'demo_url' => '',
        'author_url' => ''
    ];

    public $hasAdmin = 1;

    public function install()
    {
        return true;
    }

    public function uninstall()
    {
        $file = $_SERVER['DOCUMENT_ROOT'] . "/sitemap." . "xml";
        if (!unlink($file)) {
            return false;
        } else {
            return true;
        }
    }

}